﻿using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XiaFControl.Demo.ViewModels
{
    public partial class InputViewModel : ObservableObject
    {
        public InputViewModel()
        {
            DataList = new ObservableCollection<string>() { "张三", "李四", "王二" };
            ItemModelList = new ObservableCollection<ItemModel>()
            {
                new  ItemModel(){ Id=1,Name="张三"},
                new  ItemModel(){ Id=2,Name="李四"},
                new  ItemModel(){ Id=3,Name="王二"}
            };
            HexCode = "#FF0000";
        }
        [ObservableProperty]
        private ObservableCollection<string> dataList;

        [ObservableProperty]
        private ObservableCollection<ItemModel> itemModelList;

        [ObservableProperty]
        private string hexCode;
    }

    public class ItemModel
    {
        public int Id { get; set; }
        public string Name { get; set; }
    }
}
